<template>
  <div class="addContainer">
    <!-- 当前最新的count的值为: {{$store.state.count}}<br> -->
    {{ showNum }}
    <button @click="lowerCount">-2</button>
    <button @click="lowerNAsync(4)">-4 Async</button>
    </div>
</template>

<script>
import { mapMutations } from 'vuex'
import { mapActions } from 'vuex'
import { mapGetters } from 'vuex'
export default {
  methods: {
    ...mapMutations(['lower', 'lowerN']),
    ...mapActions(['lowerNAsync']),
    lowerCount () {
      this.lowerN(2)
    }
  },
  computed: {
    // 导入的容器在计算属性内部
    ...mapGetters(['showNum'])
  }
}
</script>

<style lang="less" scoped>
  .addContainer{
    // height: 200px;
    // background-color: aqua;
  }
</style>